<template>
	<u-tabbar :value="active" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" activeColor="#ff3b26">
		<u-tabbar-item text="首页" name="0" @click="$redirect('/'+path[0])">
            <image class="tab-image" mode="widthFix" slot="active-icon" src="/static/admin/image/b11.jpg" />
			<image class="tab-image" mode="widthFix" slot="inactive-icon" src="/static/admin/image/b1.jpg" />
		</u-tabbar-item>
        <u-tabbar-item text="订单管理" name="1" @click="$redirect('/'+path[1])">
            <image class="tab-image" mode="widthFix" slot="active-icon" src="/static/admin/image/b22.jpg" />
			<image class="tab-image" mode="widthFix" slot="inactive-icon" src="/static/admin/image/b2.jpg" />
		</u-tabbar-item>
        <u-tabbar-item text="结算管理" name="2" @click="$redirect('/'+path[2])">
            <image class="tab-image" mode="widthFix" slot="active-icon" src="/static/admin/image/b33.jpg" />
			<image class="tab-image" mode="widthFix" slot="inactive-icon" src="/static/admin/image/b3.jpg" />
		</u-tabbar-item>
		<u-tabbar-item text="商品列表" name="2" @click="$redirect('/'+path[3])">
		    <image class="tab-image" mode="widthFix" slot="active-icon" src="/static/admin/image/b4.png" />
			<image class="tab-image" mode="widthFix" slot="inactive-icon" src="/static/admin/image/b44.png" />
		</u-tabbar-item>
	</u-tabbar>
</template>
<script>
export default {
	data() {
		return {
            active:"0",
            path:['admin/index/index','admin/selectorder/selectorder','admin/settlement/settlement','admin/mygoods/mygoods']
        }
	},
    created() {
        // #ifdef MP-WEIXIN
        let pages = getCurrentPages();
        let page = pages[pages.length - 1];
        this.active = String(this.path.indexOf(page.route))
        // #endif
    }
}
</script>

<style lang="scss">
    .tab-image{
        width: 40rpx;
        height: 40rpx;
    }
</style>